<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('Activity/index')}" data-original-title="">活动管理</a> <a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>{$meta_title} - 订单号：{:I('order_id', 0)}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="">
							<div class="control-group">
								<label class="control-label">回访内容:</label>
								<div class="controls">
									<select class="form-control span2" name="visit_type">
										<volist name="Think.config.VISIT_TYPE" id="vo">
											<option value="{$key}">{$vo}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">是否合格:</label>
								<div class="controls">
									<select class="form-control span2" name="is_pass">
											<option value="1">是</option>
											<option value="0">否</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">申请识别码:</label>
								<div class="controls">
									<select class="form-control span2" name="is_code" >
											<option value="0">否</option>
											<option value="1">是</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">是否申诉:</label>
								<div class="controls">
									<select class="form-control span2" name="is_complain" >
											<option value="0">否</option>
											<option value="1">是</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">备注信息:</label>
								<div class="controls">
									<textarea name="remark"  placeholder="备注信息" class="span8" style="height:200px;">{$info.remark|htmlspecialchars}</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">识别码:</label>
								<div class="controls">
									<input type="text" placeholder="识别码" class="ui-wizard-content span2" name="check_code" value="{$info.check_code}" >
								</div>
							</div>
							
							<div class="form-actions">
								<button class="btn btn-success" type="submit">提交</button>
							</div>
							<input type="hidden" name="order_id" value="{:I('order_id', 0)}"/>
						</form>
					</div>
					<notempty name="visit_list">
						<div class="widget-content">
						<h3>回访记录</h3>
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th nowrap="nowrap">序号</th>
									<th nowrap="nowrap">回访人</th>
									<th nowrap="nowrap">回访时间</th>
								</tr>
							</thead>
							<tbody>
								<volist name="visit_list" id="vo">
									<tr>
										<td class="taskStatus">{$i}</td>
										<td class="taskStatus">{$vo.member_id|getUserName}</td>
										<td class="taskStatus">{$vo.create_time|time_format}</td>
									</tr>
								</volist>
							</tbody>
						</table>
						</div>
					</notempty>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){

	set_value("visit_type","{$info.visit_type}");
	set_value("is_pass","{$info.is_pass}");
	set_value("is_code","{$info.is_code}");
	set_value("is_complain","{$info.is_complain}");
	
	//初始化登录用户名输入焦点
	$("form").submit(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{:U('CheckOrder/checkUpdate')}", self.serialize(), call_back, "json");
		return false;
		
		/**
		 * @todo 接收登录返回值
		 * @author PHP@妖孽 <dino_ma@163.com>
		 */
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				  if (data.url) {
						location.href=data.url;
					}else{
						location.href= '{$last_url}';
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('CheckOrder/checkOrderList')}");
});
</script>
</block>